**** LOAD DATA
use "..\data\usmca_google_trends.dta"

***CONFIGURATION FOR TIME VARIABLE
gen date1=date(week,"MDY") 
*generating the STATA date variable
search labutil
labmask date1, values(week)
*labutil gives a label for the new date variable to make graphing easier
tsset date1, weekly
format date1 %td
*setting the time variable

*INITIAL GRAPHS(these didn't include the search term "United States Mexico Canada Agreement" which is distinct from USMCA acronym, therefore these are out of date
graph twoway tsline totalusacanadaunitedstatesmexico totalusausmca totalusaunitedstatescanadamexico totalusanafta totalusanewnafta totalusafreetrade
graph twoway tsline totalcancanadaunitedstatesmexico totalcanusmca totalcanunitedstatescanadamexico totalcannafta totalcannewnafta totalcanfreetrade

***USE TOP TIME VARIABLE CONFIGURATION
***This is for ALL Search Terms, with Canada and USA
graph twoway tsline totalusacanadaunitedstatesmexico totalusausmca totalusaunitedstatescanadamexico totalusanafta totalusanewnafta totalusafreetrade totalusaunitedstatesmexicocanada
graph twoway tsline totalcancanadaunitedstatesmexico totalcanusmca totalcanunitedstatescanadamexico totalcannafta totalcannewnafta totalcanfreetrade unitedstatesmexicocanadaagreemen
***NEW DATA SET
***This is for search terms excluding NAFTA; therefore, all search terms relative to USMCA (which has highest peak popularity)
graph twoway tsline ususmca usunitedstatesmexicocanadaagreem usfreetrade uscanadaunitedstatesmexicoagreem usnewnafta usunitedstatescanadamexicoagreem
graph twoway tsline usmcacanada unitedstatesmexicocanadaagreemen freetradecanada canadaunitedstatesmexicoagreemen newnaftacanada unitedstatescanadamexicoagreemen
***search terms including NAFTA and Free Trade
graph twoway tsline ususmca usunitedstatesmexicocanadaagreem uscanadaunitedstatesmexicoagreem usnewnafta usunitedstatescanadamexicoagreem
graph twoway tsline usmcacanada unitedstatesmexicocanadaagreemen canadaunitedstatesmexicoagreemen newnaftacanada unitedstatescanadamexicoagreemen
***search TOPIC USMCA only
graph twoway tsline usmcatopicunitedstates
graph twoway tsline usmcatopiccanada
***search TOPICS USMCA and Free Trade
graph twoway tsline usmcatopicunitedstates freetradetopicunitedstates
graph twoway tsline usmcatopiccanada freetradetopiccanada
